//
//  UIColor+DDAdd.swift
//  Spark Peso
//
//  Created by 小琦 on 2025/1/27.
//

import Foundation
import UIKit

extension UIColor {
    
    convenience init?(hex: String) {
        var hexString = hex.trimmingCharacters(in: .whitespacesAndNewlines)
        hexString = hexString.replacingOccurrences(of: "#", with: "")

        var rgb: UInt64 = 0
        guard Scanner(string: hexString).scanHexInt64(&rgb) else {
            return nil
        }

        let red = CGFloat((rgb >> 16) & 0xFF) / 255.0
        let green = CGFloat((rgb >> 8) & 0xFF) / 255.0
        let blue = CGFloat(rgb & 0xFF) / 255.0
            
        self.init(red: red, green: green, blue: blue, alpha: 1.0)
    }
    
    static var mainTextColor : UIColor {
        return UIColor(hex: "9521F1")!
    }
    
    static var tabNormalColor : UIColor {
        return UIColor(hex: "D8D8D8")!
    }
    
    static var xq_black : UIColor {
        return UIColor(hex: "2C3134")!
    }
}
